import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class ChatServer {
    public static void main(String[] args) throws Exception {
        try {
            //ServerSocket
            ServerSocket serverSocket = new ServerSocket(9900);
            System.out.println("服务器启动成功");
            while (true) {
                Socket accept = serverSocket.accept();
                new Thread(new ChatChannel(accept)).start();
        }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}

